package com.fangyi.yunmusic.service.utils;

import com.fangyi.yunmusic.pojo.User;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class MapConvertUtils {

    public static Map<String, User> convertToUserMap(List<User> users) {
        if(users==null)
            return null;
        return users.stream().collect(Collectors.toMap(User::getId, user -> user));
    }
}
